package com.ap.core.domain;

import org.hibernate.annotations.Type;
import org.hibernate.annotations.TypeDef;
import org.joda.time.LocalDate;

import javax.persistence.*;

/**
 * User: Ranjit.Singh
 *
 */
@Entity
@Table(name = "T_ORDER_MERCHANT_ADDRESS")
@AttributeOverride(name = "id",column = @Column(name = "ORDER_MERCHANT_ADDRESS_ID"))
@TypeDef(name = "id", typeClass = Long.class)
public class MerchantAddress extends Identifiable<Long> {

	private static final long serialVersionUID = -438246823647823478L;

    @OneToOne
    @JoinColumn(name="ap_txn_id")
    private OrderPayment orderPayment;

    @Column(name = "ADDRESS_LINE1")
    private String addressLine1;

    @Column(name = "ADDRESS_LINE2")
    private String addressLine2;

    @Column(name = "ADDRESS_LINE3")
    private String addressLine3;

    @Column(name = "ADDRESS_LINE4")
    private String addressLine4;

    @Column(name = "ADDRESS_LINE5")
    private String addressLine5;


    @Column(name = "ADDRESS_LINE6")
    private String addressLine6;

    @Column(name = "POST_CODE")
    private String postCode;


    @Column(name = "COUNTRY_CODE")
    private String countryCode;

    @Column(name = "reconciliation_cycle_id")
    private String  reconciliationCycleId;

    @Column(name = "reconciliation_date")
    @Type(type = "org.jadira.usertype.dateandtime.joda.PersistentLocalDate")
    private LocalDate reconciliationDate;

    private MerchantAddress(){}

    public MerchantAddress(Long id,String addressLine1, String addressLine2, String countryCode, String postCode, String reconciliationCycleId, LocalDate reconciliationDate) {
        this.id=id;
        this.addressLine1 = addressLine1;
        this.addressLine2 = addressLine2;
        this.countryCode = countryCode;
        this.postCode = postCode;
        this.reconciliationCycleId = reconciliationCycleId;
        this.reconciliationDate = reconciliationDate;
    }

    public void setAddressLine3(String addressLine3) {
        this.addressLine3 = addressLine3;
    }

    public void setAddressLine4(String addressLine4) {
        this.addressLine4 = addressLine4;
    }

    public void setAddressLine5(String addressLine5) {
        this.addressLine5 = addressLine5;
    }

    public void setAddressLine6(String addressLine6) {
        this.addressLine6 = addressLine6;
    }

    public void setOrderPayment(OrderPayment orderPayment) {
        this.orderPayment = orderPayment;
    }

    public String getAddressLine1() {
        return addressLine1;
    }

    public String getAddressLine2() {
        return addressLine2;
    }

    public String getAddressLine3() {
        return addressLine3;
    }

    public String getAddressLine4() {
        return addressLine4;
    }

    public String getAddressLine5() {
        return addressLine5;
    }

    public String getAddressLine6() {
        return addressLine6;
    }

    public String getCountryCode() {
        return countryCode;
    }

    public OrderPayment getOrderPayment() {
        return orderPayment;
    }

    public String getPostCode() {
        return postCode;
    }

    public String getReconciliationCycleId() {
        return reconciliationCycleId;
    }

    public LocalDate getReconciliationDate() {
        return reconciliationDate;
    }
}
